<?php

require_once __DIR__.'/autoload.php';

use Symfony\Component\HttpFoundation\Request;

$request = Request::create('/aaa.php?name=Fabien');

// the URI being requested (e.g. /about) minus any query parameters
echo $request->getPathInfo();
 
// retrieve GET and POST variables respectively
echo $request->query->get('foo');
echo $request->request->get('bar', 'default value if bar does not exist');
 
// retrieve SERVER variables
echo $request->server->get('HTTP_HOST');
 
// retrieves an instance of UploadedFile identified by foo
echo $request->files->get('foo');
 
// retrieve a COOKIE value
echo $request->cookies->get('PHPSESSID');
 
// retrieve an HTTP request header, with normalized, lowercase keys
$request->headers->get('host');
$request->headers->get('content_type');
 
echo $request->getMethod();    // GET, POST, PUT, DELETE, HEAD
$request->getLanguages(); // an array of languages the client accepts